#include <winsock2.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h>
#include <iostream>
#include <cstdlib>
#include <curl/curl.h>
#include <process.h>
#pragma comment(lib, "curllib.lib")  
#include <Iphlpapi.h>
#pragma comment(lib,"ws2_32.lib")
#include "Extended.h"
//Functions.cpp
char* memstr(char* full_data, int full_data_len, char* substr);
u_char *Encode(u_char *str1,u_char *str2);
u_char *Decode(u_char *str1,u_char *str2);
void URLEncode(char *src,char *dst);

char *HttpPost(char *url,char *post);
size_t HttpPost_bottom(void *buffer, size_t size, size_t nmemb, void *user_p);

char *strncpy_s(char *dst,const char *src,int size);
bool URL_GBK_Decode(const char *encd, char* decd);
bool Amp_DeEscape(const char *encd, char* decd);
void Utf8_2_ANSI(char* &pOut,char *pText);
int GetVal(char *src,char *dst,char *FirstSub,char *SecondSub,char *EndSub);
int GetVal(char *src,char *dst,char *FirstSub,char *SecondSub,char endchar);
//control.cpp
//data:
/*
typedef struct _userinfo
{
char ip[40];
char logintime[100];
char mac[30];
char out[40];
char in[40];
char kyll[40];
char kyye[10];
int uid;
struct _userinfo *next;
}Userinfo;
*/
typedef struct _userinfo Userinfo;
//code:
int Login(char *usr,char *pwd,char *uid,char *err);
int WebLogin(char *usr,char *pwd,char *uid,char *err);
int RKey(char *key,char *value,bool WR);
int Do_Logout(char *uid,char *err);
int Force_Logout(char *usr,char *pwd,char *uid,char *err);
int Service(char *usr,char *pwd,Userinfo *&myuserinfo,char *err);
int DropUser(int uid);
int AutoRun(bool TF);
int CASLogin(char *usr,char *pwd,char *uid,char *err);
int Do_CASLogout(char *usr,char *pwd,char *err);


